package com.myproject.mall.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import com.myproject.mall.domain.enums.CommentStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@TableName("scmall_comment")
@Schema(description = "用户评论")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Comment {

    @Schema(description = "评论ID")
    @TableId(value = "comment_id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "评论内容")
    @TableField(value = "comment_content")
    private String content;

    @Schema(description = "用户ID")
    @TableField(value = "comment_user_id")
    private String userId;

    @Schema(description = "评论状态")
    @TableField(value = "comment_status")
    private CommentStatus status;

    @Schema(description = "上一级评论ID")
    @TableField(value = "comment_previous_id")
    private Long previousId;

    @Schema(description = "商品ID")
    @TableField(value = "comment_goods_id")
    private Long goodsId;

    @Schema(description = "评分")
    @TableField(value = "comment_score")
    private Integer score;

    @Schema(description = "图片")
    @TableField(value = "comment_pictures")
    private String pictures;

    @Schema(description = "创建时间")
    @TableField(value = "comment_create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField(value = "comment_update_time")
    private LocalDateTime updateTime;
}
